package org.ysling.litemall.core.tenant.enums;

/**
 * 忽略添加租户ID的表
 */
public enum IgnoreTableNames {

    table1("litemall_role", "角色表"),
    table2("litemall_tenant", "租户表"),
    table3("litemall_admin", "管理员表"),
    table4("litemall_region", "地区表"),
    table5("litemall_category", "分类表"),
    table6("litemall_permission", "权限表"),
    table7("litemall_system", "系统配置表"),
    table8("litemall_issue", "常见问题表"),
    table9("litemall_storage", "对象存储表");

    public final String tableName;
    public final String message;

    IgnoreTableNames(String tableName, String message) {
        this.tableName = tableName;
        this.message = message;
    }

    /**
     * 对比表名
     * @param tableName 表名
     * @return 存在true 不存在false
     */
    public static Boolean parseValue(String tableName) {
        if (tableName != null) {
            for (IgnoreTableNames item : values()) {
                if (item.tableName.equals(tableName)) {
                    return true;
                }
            }
        }
        return false;
    }
}
